package com.liuqi.project.common.model.enums;//枚举类，一些固定的多选值或者数据类型

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 接口状态枚举类
 *
 * @author liuqi
 */
public enum InterfaceInfoStatusEnum {
    OFFLINE("下线", 0),
    ONLINE("上线", 1);

    private final String text;
    private final int value;

    InterfaceInfoStatusEnum(String text, int value) {
        this.text = text;
        this.value = value;
    }
    /**
     * @return 获取列表值
     */
    public static List<Integer> getValues() {
        return Arrays
                .stream(values())
                .map(item -> item.value)
                .collect(Collectors.toList());
    }

    public String getText() {
        return text;
    }

    public int getValue() {
        return value;
    }
}
